-
Notifications
You must be signed in to change notification settings - Fork 391
Update 2013-07-11-react-v0-4-prop-validation-and-default-values.md #554
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Deploy preview for ru-reactjs ready! Built with commit 195940c |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Пожалуйста, ознакомьтесь с README.md и TRANSLATIONS.MD. Много мест, которые можно устранить до создания пулл реквестов. Они как раз отражены в этих файлах.
Ещё одна будет просьба к вам, пересмотрите пожалуйста все свои открытые PRы на наличие типичных ошибок.
|
||
|
||
## Validation {#validation} | ||
## Валидация {#валидация} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Идентификаторы разделов не нужно переводить, так как на них ссылаются в других статьях, в которых они не переводились. Подробнее можно почитать здесь
author: [zpao] | ||
--- | ||
|
||
Many of the questions we got following the public launch of React revolved around `props`, specifically that people wanted to do validation and to make sure their components had sensible defaults. | ||
Многие из вопросов, которые мы получили после публичного запуска React, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Старайтесь сохранять нумерацию строк в оригинале и в ваших переводах. Это поможет избежать конфликтов при обновлении документации из официального репозитория.
|
||
|
||
## Validation {#validation} | ||
## Валидация {#валидация} | ||
|
||
Oftentimes you want to validate your `props` before you use them. Perhaps you want to ensure they are a specific type. Or maybe you want to restrict your prop to specific values. Or maybe you want to make a specific prop required. This was always possible — you could have written validations in your `render` or `componentWillReceiveProps` functions, but that gets clunky fast. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
В вашем переводе осталась часть текста на английском языке. Пожалуйста, проверяйте свои изменения перед созданием пулл реквеста.
|
||
```js | ||
React.createClass({ | ||
propTypes: { | ||
// An optional string prop named "description". | ||
// Опциональная строковая пропса с именем "description". |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// Опциональная строковая пропса с именем "description". | |
// Опциональный строковый проп с именем "description". |
В нашем согласовании перевода приняли, что prop
переводим как проп
. В множественном числе props
переводим как пропы
.
Пожалуйста, ознакомьтесь с нашим соглашением по переводу, он находится здесь.
Это поможет вам ознакомиться с нашими принятыми соглашениями по переводу слов и имён.
dialog: React.PropTypes.instanceOf(Dialog).isRequired | ||
}, | ||
... | ||
}); | ||
``` | ||
|
||
|
||
## Default Values {#default-values} | ||
## Значения по умолчанию {#значения-по-умолчанию} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Идентификаторы разделов не нужно переводить, так как на них ссылаются в других статьях, в которых они не переводились. Подробнее можно почитать здесь
Если ваш пулреквест является исправлением бага, а не переводом, то сперва убедитесь, что проблема относится ТОЛЬКО к https://ru.reactjs.org, а не к https://reactjs.org. Если это не так, то пулреквест следует открыть в родительском репозитории.